﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SWEN3Application.Classes
{
    public class Invoice
    {
        private int invoiceId;

        public int InvoiceId
        {
            get { return invoiceId; }
            set { invoiceId = value; }
        }

        private int bookingNo;

        public int BookingNo
        {
            get { return bookingNo; }
            set { bookingNo = value; }
        }

        private int roomNo;

        public int RoomNo
        {
            get { return roomNo; }
            set { roomNo = value; }
        }

        private String roomType;

        public String RoomType
        {
            get { return roomType; }
            set { roomType = value; }
        }

        private double roomRates;

        public double RoomRates
        {
            get { return roomRates; }
            set { roomRates = value; }
        }

        private DateTime checkIn;

        public DateTime CheckIn
        {
            get { return checkIn; }
            set { checkIn = value; }
        }

        private DateTime checkOut;

        public DateTime CheckOut
        {
            get { return checkOut; }
            set { checkOut = value; }
        }

        private double currencyRates;

        public double CurrencyRates
        {
            get { return currencyRates; }
            set { currencyRates = value; }
        }

        private string creditCardNo;

        public string CreditCardNo
        {
            get { return creditCardNo; }
            set { creditCardNo = value; }
        }

        private int securityCode;

        public int SecurityCode
        {
            get { return securityCode; }
            set { securityCode = value; }
        }

        private string cardType;

        public string CardType
        {
            get { return cardType; }
            set { cardType = value; }
        }

        private DateTime expiryDate;

        public DateTime ExpiryDate
        {
            get { return expiryDate; }
            set { expiryDate = value; }
        }

        public int getNumberOfDays()
        {
            TimeSpan duration = checkOut.Subtract(checkIn);
            return duration.Days;
        }

        public double calculateTotal()
        {
            int dayNo = getNumberOfDays();
            return dayNo * roomRates;
        }

        public double calculateTotalToCurrency()
        {
            return Convert.ToDouble(Math.Round(calculateTotal() * currencyRates,2));
        }

    }
}